package com.itfreer.power.dao.organize;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;

import org.springframework.beans.BeanUtils;

import com.itfreer.form.api.JdbcBaseEntity;
import com.itfreer.power.dao.base.JdbcEntityBase;
import com.itfreer.power.entity.organize.DepartmentEntity;

/**
 * jdbc部门
 */
@Entity(name = "sso_organize_department")
@Table(indexes = { 
        @Index(name="sso_department_code", columnList="s_code")})
public class JdbcDepartmentEntity extends JdbcEntityBase implements JdbcBaseEntity<DepartmentEntity> {
	
	private static final long serialVersionUID = 5390795629493415062L;

	/**
	 * 所属机构
	 */
	@Column(name = "s_organizationId", length = 50, nullable = true)
	private String organizationId;
	
	/**
	 * 部门电话
	 */
	@Column(name = "s_tel", length = 50, nullable = true)
	private String tel;

	/**
	 * 所属机构
	 */
	public String getOrganizationId() {
		return organizationId;
	}

	/**
	 * 所属机构
	 */
	public void setOrganizationId(String organizationId) {
		this.organizationId = organizationId;
	}

	/**
	 * 部门电话
	 */
	public String getTel() {
		return tel;
	}

	/**
	 * 部门电话
	 */
	public void setTel(String tel) {
		this.tel = tel;
	}

	@Override
	public void from(DepartmentEntity t) {
		BeanUtils.copyProperties(t, this);
	}

	@Override
	public DepartmentEntity toEntity() {
		DepartmentEntity toEntity = new DepartmentEntity();
		BeanUtils.copyProperties(this, toEntity);
		return toEntity;
	}
}
